package test;

import mapper.ConnectionPoll;
import pojo.ConnData;
import pojo.ManageConnection;

import java.sql.Connection;

public class test1 {
    public static void main(String[] args) {
        System.out.println("version3");
        PoolThread poolThread = new PoolThread();
        for (int i = 0; i < 5; i++) {
            Thread thread = new Thread(poolThread,"线程"+i);
            thread.start();
        }

    }
}

class PoolThread implements Runnable{

    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            Connection connection = ManageConnection.getConnection();
            System.out.println("当前线程："+Thread.currentThread().getName()+"connection: "+connection);
            ManageConnection.releaseConnection(connection);
        }

    }


}
